_require "../../../../basis.smi"
_require "../../../../smlformat-lib.smi"
_require "../../../../smlnj-lib/Util2/binary-map-fn2.smi"
_require "../../../../smlnj-lib/Util/binary-set-fn.smi"
_require "./Symbol.smi"

structure RecordLabel =
struct

  eqtype label (= string)

  val fromSymbol : Symbol.symbol -> label
  val fromLongsymbol : Symbol.longsymbol -> label
  val fromInt : int -> label
  val fromString : string -> label
  val toString : label -> string
  val escapeString : label -> string
  val compare : label * label -> order
  val format_label : label -> SMLFormat.FormatExpression.expression list
  val format_jsonLabel : label -> SMLFormat.FormatExpression.expression list

  structure Ord =
  struct
    type ord_key = label
    val compare : label * label -> order
  end

  structure Map = BinaryMapFn2(Ord)
  structure Set = BinarySetFn(Ord)

  val isTupleList : (label * 'a) list -> bool
  val isTupleMap : 'a Map.map -> bool
  val isOrderedList : (label * 'a) list -> bool
  val isOrderedMap : 'a Map.map -> bool
  val tupleList : 'a list -> (label * 'a) list
  val tupleMap : 'a list -> 'a Map.map

end
